package com.ww.sound_emission;

import io.minio.BucketExistsArgs;
import io.minio.MinioClient;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.web.bind.annotation.CrossOrigin;

import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * @autor 96901
 * @date 2025/1/5
 */
@SpringBootTest
public class nefeu {


    @Autowired
    private MinioClient minioClient;

    @Value("${minio.bucket-name}")
    private String bucketName;

    /**
     * 测试 MinIO 连接
     */
    @Test
    public void testMinioConnection() throws Exception {
        // 检查 MinIO 服务器是否可用
        assertTrue(minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build()),
                "MinIO 连接失败，请检查配置！");
    }



}
